package com.ssm;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

 public class IdeaDB extends SQLiteOpenHelper {

	
	private String db_name;
	public IdeaDB(Context context, String name) {
		super(context, name, null, 1);
		db_name = name;
		
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		
		db.execSQL("CREATE TABLE "+db_name+"(_id INTEGER PRIMARY KEY,"
				+"key1 TEXT,key2 TEXT,key3 TEXT,detail TEXT);");
		
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS "+db_name+"");
		onCreate(db);
		
	}      

	 
 } 

